package com.azier.kapacitor.script.node;

import com.azier.kapacitor.script.arg.OriginalArg;
import com.azier.kapacitor.script.method.Quiet;
import com.azier.kapacitor.script.method.Rename;
import com.azier.kapacitor.script.node.nodebind.CommonNodeBind;

import java.util.ArrayList;

/**
* 1 * @Author: luoj
* 2 * @Date: 2019/11/8 11:27
* 3
*/

/**
Join this node with other nodes. The data is joined on timestamp.
**/

/**
将这个节点与其他节点一起加入。数据在时间戳上加入。
**/
public class UnionNode extends AbstractNode implements CommonNodeBind {
    private static final String name = "union";

    public UnionNode(Node ...others) {
        super(new ArrayList<>(),new ArrayList<>(),name);
        //
        for(Node argf : others){
        this.args.add(new OriginalArg(argf.getNodeName()));
        }
    }

    /**
    Suppress all error logging events from this node.
    **/
    /**
    禁止来自此节点的所有错误记录事件。
    **/
    public UnionNode quiet(){
        Quiet quiet = new Quiet();
        super.addMethod(quiet);
        return this;
    }

    public UnionNode rename(String name){
        Rename rename = new Rename(name);
        super.addMethod(rename);
        return this;
    }
}